#include "libs/lib.h"

unsigned long pow(unsigned long x, unsigned long y)
{

	unsigned long temp = x;

	if (y == 0)
	{	
		/* code */
		return 1;
	}

	
	for (unsigned long  i = 1; i < y; i++)
	{
		x *= temp;
		
	}
	

	return x;
}

bool hd_detect(unsigned long a,unsigned long b,unsigned long reg,unsigned long index){

	unsigned int c,d,e,f;
	
	get_cpuid(a,b,&c,&d,&e,&f);

	if (reg >= 4 || reg < 0)
		return false;
	{
		/* code */
	}
	
	switch (reg	)
	{
	case 0:
		/* code */
		return (c & (1<< index));
		break;
	case 1:
		/* code */
		return (d & (1<< index));
		break;
	case 2:
	/* code */
		return (e & (1<< index));
		break;
	case 3:
		/* code */
		return (f & (1<< index));
		break;
	}
	return false;
}


unsigned long getAPICID(){

	return rdmsr(IA32_APIC_ID);

}